import { Module } from '@nestjs/common'
import { AuthService } from './auth.service'
import { PassportModule } from '@nestjs/passport'
import { JwtModule, JwtService } from '@nestjs/jwt'
import { jwtConstants } from './constants'
import { StaffModule } from 'src/modules/staff/staff.module'
import { JwtStrategy } from './strategy/jwt.strategy'
import { AdminModule } from 'src/modules/admin/admin.module'
@Module({
  imports: [
    StaffModule,
    AdminModule,
    PassportModule.register({ defaultStrategy: 'jwt' }),
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: {
        expiresIn: jwtConstants.expiresIn
      }
    })
  ],
  providers: [AuthService, JwtStrategy],
  exports: [AuthService]
})
export class AuthModule {}
